<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../../js/angular.min.js"></script>	
	</head>
	<body>
		<div ng-app="xyx" ng-controller="xyxzs">
			<div>
				<input type="text" name="name" ng-model="name"/>
				<!-- 提供按钮 -->
				<input type="button" value="清空" ng-click="clearVal()"/>
			</div>
			<div>
				hello,{{name}}
			</div>
		</div>
		<script type="text/javascript">
			//初始化xyx模块
			var xyx = angular.module("xyx",[]);
			
			//定义模块控制器
			//依赖注入
			xyx.controller("xyxzs", ["$scope", function($scope){
				$scope.name="我是傻逼";
				$scope.clearVal = function() {
					$scope.name="";
				}
			}]);
		</script>
	</body>
</html>
